package com.kingtone.rongji.ui;

import android.app.ProgressDialog;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.animation.Animation;
import android.widget.ImageView;

import com.kingtone.rongji.R;

public class LoadingProgress extends ProgressDialog {

	public LoadingProgress(Context context) {
		super(context);
	}

	public LoadingProgress(Context context, int theme) {
		super(context, theme);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.loading_progress);
		
		ImageView view = (ImageView) findViewById(R.id.spinnerImageView);
		AnimationDrawable animation = (AnimationDrawable) view.getBackground();
		animation.start();
	}

	public LoadingProgress show(Context ctx){
		LoadingProgress dialog = new LoadingProgress(ctx);
		dialog.show();
		return dialog;
	}

}
